home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_217 / stevie / help.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  7KB  |  308 lines

  1. /*
  2.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  *
  4.  * Code Contributions By : Tim Thompson           twitch!tjt
  5.  *                         Tony Andrews           onecom!wldrdg!tony 
  6.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  7.  */
  8.  
  9. #include "stevie.h"
  10.  
  11. extern char    *Version;
  12.  
  13. static int      helprow;
  14.  
  15. #ifdef  HELP
  16.  
  17. #ifdef  MEGAMAX
  18. overlay "help"
  19. #endif
  20.  
  21. static void     longline();
  22.  
  23. bool_t
  24. help()
  25. {
  26.     outstr(T_ED);
  27.     windgoto(helprow = 0, 0);
  28.  
  29.     longline("\
  30. Positioning within file\n\
  31. =======================\n\
  32. ^F\t\tForward screenfull             Worked on by:\n\
  33. ^B\t\tBackward screenfull                Tim Thompson\n");
  34.     longline("\
  35. ^D\t\tscroll down half screen            Tony Andrews\n\
  36. ^U\t\tscroll up half screen              G.R. (Fred) Walter\n");
  37.     longline("\
  38. G\t\tGoto line (end default)\n\
  39. ]]\t\tnext function\n\
  40. [[\t\tprevious function\n\
  41. /re\t\tnext occurence of regular expression 're'\n");
  42.     longline("\
  43. ?re\t\tprior occurence of regular expression 're'\n\
  44. n\t\trepeat last / or ?\n\
  45. N\t\treverse last / or ?\n\
  46. %\t\tfind matching (, ), {, }, [, or ]\n");
  47.     longline("\
  48. \n\
  49. Adjusting the screen\n\
  50. ====================\n\
  51. ^L\t\tRedraw the screen\n\
  52. ^E\t\tscroll window down 1 line\n\
  53. ^Y\t\tscroll window up 1 line\n");
  54.     longline("\
  55. z<RETURN>\tredraw, current line at top\n\
  56. z-\t\t... at bottom\n\
  57. z.\t\t... at center\n");
  58.  
  59.     windgoto(0, 32);
  60.     longline(Version);
  61. #ifdef AMIGA
  62.     longline(" ");
  63.     longline(__DATE__);
  64.     longline(" ");
  65.     longline(__TIME__);
  66. #endif
  67.  
  68.     windgoto(helprow = Rows - 2, 47);
  69.     longline("<Press space bar to continue>\n");
  70.     windgoto(helprow = Rows - 1, 47);
  71.     longline("<Any other key will quit>");
  72.  
  73.     if (vgetc() != ' ')
  74.     return TRUE;
  75.  
  76.     outstr(T_ED);
  77.     windgoto(helprow = 0, 0);
  78.  
  79.     longline("\
  80. Character Positioning\n\
  81. =====================\n\
  82. ^\t\tfirst non-white\n\
  83. 0\t\tbeginning of line\n\
  84. $\t\tend of line\n\
  85. h\t\tbackward\n");
  86.     longline("\
  87. l\t\tforward\n\
  88. ^H\t\tsame as h\n\
  89. space\t\tsame as l\n\
  90. fx\t\tfind 'x' forward\n");
  91.     longline("\
  92. Fx\t\tfind 'x' backward\n\
  93. tx\t\tupto 'x' forward\n\
  94. Tx\t\tupto 'x' backward\n\
  95. ;\t\tRepeat last f, F, t, or T\n");
  96.     longline("\
  97. ,\t\tinverse of ;\n\
  98. |\t\tto specified column\n\
  99. %\t\tfind matching (, ), {, }, [, or ]\n");
  100.  
  101.     windgoto(helprow = Rows - 2, 47);
  102.     longline("<Press space bar to continue>\n");
  103.     windgoto(helprow = Rows - 1, 47);
  104.     longline("<Any other key will quit>");
  105.  
  106.     if (vgetc() != ' ')
  107.     return TRUE;
  108.  
  109.     outstr(T_ED);
  110.     windgoto(helprow = 0, 0);
  111.  
  112.     longline("\
  113. Line Positioning\n\
  114. ================\n\
  115. H\t\thome window line\n\
  116. L\t\tlast window line\n\
  117. M\t\tmiddle window line\n");
  118.     longline("\
  119. +\t\tnext line, at first non-white\n\
  120. -\t\tprevious line, at first non-white\n\
  121. CR\t\treturn, same as +\n\
  122. j\t\tnext line, same column\n\
  123. k\t\tprevious line, same column\n");
  124.  
  125.     longline("\
  126. \n\
  127. Marking and Returning\n\
  128. =====================\n\
  129. ``\t\tprevious context\n\
  130. ''\t\t... at first non-white in line\n");
  131.     longline("\
  132. mx\t\tmark position with letter 'x'\n\
  133. `x\t\tto mark 'x'\n\
  134. 'x\t\t... at first non-white in line\n");
  135.  
  136.     windgoto(helprow = Rows - 2, 47);
  137.     longline("<Press space bar to continue>\n");
  138.     windgoto(helprow = Rows - 1, 47);
  139.     longline("<Any other key will quit>");
  140.  
  141.     if (vgetc() != ' ')
  142.     return TRUE;
  143.  
  144.     outstr(T_ED);
  145.     windgoto(helprow = 0, 0);
  146.  
  147.     longline("\
  148. Insert and Replace\n\
  149. ==================\n\
  150. a\t\tappend after cursor\n\
  151. i\t\tinsert before cursor\n\
  152. A\t\tappend at end of line\n\
  153. I\t\tinsert before first non-blank\n");
  154.     longline("\
  155. o\t\topen line below\n\
  156. O\t\topen line above\n\
  157. rx\t\treplace single char with 'x'\n\
  158. R\t\treplace characters (not yet)\n\
  159. ~\t\treplace character under cursor with other case\n");
  160.  
  161.     longline("\
  162. \n\
  163. Words, sentences, paragraphs\n\
  164. ============================\n\
  165. w\t\tword forward\n\
  166. b\t\tback word\n\
  167. e\t\tend of word\n\
  168. )\t\tto next sentence (not yet)\n\
  169. }\t\tto next paragraph (not yet)\n");
  170.     longline("\
  171. (\t\tback sentence (not yet)\n\
  172. {\t\tback paragraph (not yet)\n\
  173. W\t\tblank delimited word\n\
  174. B\t\tback W\n\
  175. E\t\tto end of W");
  176.  
  177.     windgoto(helprow = Rows - 2, 47);
  178.     longline("<Press space bar to continue>\n");
  179.     windgoto(helprow = Rows - 1, 47);
  180.     longline("<Any other key will quit>");
  181.  
  182.     if (vgetc() != ' ')
  183.     return TRUE;
  184.  
  185.     outstr(T_ED);
  186.     windgoto(helprow = 0, 0);
  187.  
  188.     longline("\
  189. Undo  &  Redo\n\
  190. =============\n\
  191. u\t\tundo last change\n\
  192. U\t\trestore current line (not yet)\n\
  193. .\t\trepeat last change\n");
  194.  
  195.     longline("\
  196. \n\
  197. File manipulation\n\
  198. =================\n");
  199.     longline("\
  200. :w\t\twrite back changes\n\
  201. :wq\t\twrite and quit\n\
  202. :x\t\twrite if modified, and quit\n\
  203. :q\t\tquit\n\
  204. :q!\t\tquit, discard changes\n\
  205. :e name\t\tedit file 'name'\n");
  206.     longline("\
  207. :e!\t\tre-edit, discard changes\n\
  208. :e #\t\tedit alternate file\n\
  209. :w name\t\twrite file 'name'\n");
  210.     longline("\
  211. :n\t\tedit next file in arglist\n\
  212. :n args\t\tspecify new arglist (not yet)\n\
  213. :rew\t\trewind arglist\n\
  214. :f\t\thow current file and lines\n");
  215.     longline("\
  216. :f file\t\tchange current file name\n\
  217. :ta tag\t\tto tag file entry 'tag'\n\
  218. ^]\t\t:ta, current word is tag");
  219.  
  220.     windgoto(helprow = Rows - 2, 47);
  221.     longline("<Press space bar to continue>\n");
  222.     windgoto(helprow = Rows - 1, 47);
  223.     longline("<Any other key will quit>");
  224.  
  225.     if (vgetc() != ' ')
  226.     return TRUE;
  227.  
  228.     outstr(T_ED);
  229.     windgoto(helprow = 0, 0);
  230.  
  231.     longline("\
  232. Operators (double to affect lines)\n\
  233. ==================================\n\
  234. d\t\tdelete\n\
  235. c\t\tchange\n");
  236.     longline("\
  237. <\t\tleft shift\n\
  238. >\t\tright shift\n\
  239. y\t\tyank to buffer\n");
  240.  
  241.     longline("\n\
  242. Yank and Put\n\
  243. ============\n\
  244. p\t\tput back text\n\
  245. P\t\tput before\n\
  246. Y\t\tyank lines");
  247.  
  248.     windgoto(helprow = Rows - 2, 47);
  249.     longline("<Press space bar to continue>\n");
  250.     windgoto(helprow = Rows - 1, 47);
  251.     longline("<Any other key will quit>");
  252.  
  253.     if (vgetc() != ' ')
  254.     return TRUE;
  255.  
  256.     outstr(T_ED);
  257.     windgoto(helprow = 0, 0);
  258.  
  259.     longline("\n\
  260. Miscellaneous operations\n\
  261. ========================\n\
  262. C\t\tchange rest of line\n\
  263. D\t\tdelete rest of line\n\
  264. s\t\tsubstitute chars\n");
  265.     longline("\
  266. S\t\tsubstitute lines (not yet)\n\
  267. J\t\tjoin lines\n\
  268. x\t\tdelete characters\n\
  269. X\t\t... before cursor\n\
  270. :[range]s/search/replace/[g]\n\
  271. :[range]g/search[/p|/d]\n\
  272. :[range]d\tdelete range of lines\n");
  273.  
  274.     windgoto(helprow = Rows - 1, 47);
  275.     longline("<Press any key>");
  276.  
  277.     vgetc();
  278.  
  279.     return TRUE;
  280. }
  281.  
  282. static void
  283. longline(p)
  284.     char           *p;
  285. {
  286. # ifdef AMIGA
  287.     outstr(p);
  288. # else
  289.     char           *s;
  290.  
  291.     for (s = p; *s; s++) {
  292.     if (*s == '\n')
  293.         windgoto(++helprow, 0);
  294.     else
  295.         outchar(*s);
  296.     }
  297. # endif
  298. }
  299. #else
  300.  
  301. bool_t
  302. help()
  303. {
  304.     msg("Sorry, help not configured");
  305.     return FALSE;
  306. }
  307. #endif
  308.